<template>
  <div>
    <group  label-width="100px">
      <cell title="来办对象:" :value='dataContent.unitName'></cell>
      <cell title="办件序号:" :value='guid'></cell>
      <cell title="办件名称:" :value='dataContent.matName'></cell>
      <cell title="来办时间:" :value='dataContent.startDoDateStr'></cell>
      <cell title="审批时间:" :value='dataContent.checkDateStr'></cell>
      <cell title="办理状态:" :value='dataContent.checktache'></cell>
      <cell title="审批结果:" :value='dataContent.checkResult'></cell>
      <cell title="审批意见:" :value='dataContent.checkIdea'></cell>
    </group>
  </div>
</template>
<script type="text/ecmascript-6">
  import { Group, Cell } from 'vux'
  export default {

    data(){
      return {
        guid: this.$route.params.tskNum,
        dataContent :{
          unitName:'',
          matName:'',
          startDoDateStr:'',
          checktache:'',
          checkResult:'',
          checkDateStr:'',
          checkIdea:''
        }
      }
    },
    components:{
      Group,
      Cell
    },
    created(){
      this.initData();
    },
    methods:{
      initData(){
        let _self = this;
        this.axios.get(global.baseApiUrl+'/tasks/tsk/'+_self.guid)
          .then(function (response) {
           let d =response.data.data;
           console.log(d);
            _self.dataContent.unitName=d.unitName;
            _self.dataContent.matName=d.matName;
            _self.dataContent.startDoDateStr=d.startDoDateStr;
             if(d.checkInfos.length===0)
             {

               _self.dataContent.checktache=d.projectStatusCn;
             }
             else
             {
               _self.dataContent.checktache=d.checkInfos[0].checktache;
               _self.dataContent.checkResult=d.checkInfos[0].checkResult=='OK'?'通过':'不通过';
               _self.dataContent.checkDateStr=d.checkInfos[0].checkDateStr;
               _self.dataContent.checkIdea=d.checkInfos[0].checkIdea;
             }


          })
          .catch(function (response) {
            //报错打印错误信息
            console.log(response);
          });
      }
    }
  }
</script>


